package com.wwj.code.login.token.service.impl;

import com.wwj.code.util.numberUtils.SnowIdUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wwj.code.login.token.entity.UserToken;

import java.util.List;

import com.wwj.code.login.token.mapper.UserTokenMapper;
import com.wwj.code.login.token.service.UserTokenService;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserTokenServiceImpl extends ServiceImpl<UserTokenMapper, UserToken> implements UserTokenService {


    @Override
    public String createQrImg() {
        String s = SnowIdUtils.uniqueLongHex();
        UserToken userToken = new UserToken();
        userToken.setUuid(s);
        userToken.setCreateTime(new Date());
        baseMapper.insert(userToken);
        return s;
    }


    @Override
    public int updateBatch(List<UserToken> list) {
        return baseMapper.updateBatch(list);
    }

    @Override
    public int batchInsert(List<UserToken> list) {
        return baseMapper.batchInsert(list);
    }

    @Override
    public int insertOrUpdate(UserToken record) {
        return baseMapper.insertOrUpdate(record);
    }

    @Override
    public int insertOrUpdateSelective(UserToken record) {
        return baseMapper.insertOrUpdateSelective(record);
    }
}



